<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>流量卡充值审核管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#checkAll").click(function () {
				$("input[name='id']:checkbox").prop("checked", this.checked);            
			});
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
		
		//批量审核
		function batchExamine(){
			var delList = [];
			$("#contentTable .checkbox-hook:checked").each(function (){
				delList.push($(this).val());
			})
			if(delList.length == 0){
				$.jBox.tip('请至少选择一条数据审核。', 'error');
			}else{
				$.jBox.confirm("确认要审核"+delList.length+"条订单吗？", "提示信息", submit, { buttons: { '确定': true, '取消': false} });
				$("#ids").val(delList);
			}
		}
		var submit = function (v, h, f) {
		    if (v == true){
		    	loading('提交中，请稍等...');
	    		$("#examineForm").attr("action", "${ctx}/recharge/rechargeLs/examine");
	    		$("#examineForm").submit();
		    }
		    return true;
		};
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/recharge/rechargeLs/examine_list">流量卡充值审核列表</a></li>
	</ul>
	<form:form id="searchForm" modelAttribute="rechargeLs" action="${ctx}/recharge/rechargeLs/examine_list" method="post" class="breadcrumb form-search">
		<input id="pageNo" name="pageNo" type="hidden" value="${page.pageNo}"/>
		<input id="pageSize" name="pageSize" type="hidden" value="${page.pageSize}"/>
		<ul class="ul-form">
			<li><label>流量卡编号：</label>
				<form:input path="iccid" htmlEscape="false" maxlength="48" class="input-medium"/>
			</li>
			<li><label>内部订单号：</label>
				<form:input path="nborderno" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>充值订单号：</label>
				<form:input path="czorderno" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>流水号：</label>
				<form:input path="lsno" htmlEscape="false" maxlength="255" class="input-medium"/>
			</li>
			<li><label>充值时间：</label>
				<input name="orderstartdate"  type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
					value="<fmt:formatDate value="${rechargeLs.orderstartdate}" pattern="yyyy-MM-dd"/>"
					onclick="WdatePicker({dateFmt:'yyyy-MM-dd',isShowClear:false});"/>
			</li>
			<li class="btns">
				<a id="btnSubmit" class="btn btn-primary" onclick="return page();"><i class="icon-search"></i>&nbsp;查询</a>
			</li>
		</ul>
	</form:form>
		<div class="breadcrumb">
		<shiro:hasPermission name="recharge:examine:examine">
			<form id="examineForm" method="post" style="display:inline-block;margin: 0 0 0px">
				<input type="hidden" id="ids" name="ids" value=""/>
		  		<a class="btn btn-danger" type="button" onclick="batchExamine()" ><i class="icon-pencil"></i>&nbsp;批量审核</a>
		  	</form>
	  	</shiro:hasPermission>
	</div>
	<sys:message content="${message}"/>
	<table id="contentTable" class="table table-striped table-bordered table-condensed">
		<thead>
			<tr>
				<th><input type="checkbox" id="checkAll"/></th>
				<th>流量卡编号</th>
				<th>代理商ID</th>
				<th>金额</th>
				<th>充值套餐</th>
				<th>付款状态 </th>
				<th>充值状态</th>
				<th>内部订单号</th>
				<th>充值订单号</th>
				<th>流水号</th>
				<th>充值时间</th>
				<th>付款时间</th>
			</tr>
		</thead>
		<tbody>
		<c:choose>
			<c:when test="${not empty page.list}">
				<c:forEach items="${page.list}" var="rechargeLs">
					<tr>
						<td><input class="checkbox-hook" type="checkbox" name="id" value="${rechargeLs.id}"/></td>
						<td>
							${rechargeLs.iccid}
						</a>
						</td>
						<td>
							${rechargeLs.agentId}
						</td>
						<td>
							${rechargeLs.money}
						</td>
						<td>
							${rechargeLs.rechargetc}
						</td>
						<td>
							${fns:getDictLabel(rechargeLs.paystate, 'paystate', '')}
						</td>
						<td>
							${fns:getDictLabel(rechargeLs.czstate, 'czstate', '')}
						</td>
						<td>
							${rechargeLs.nborderno}
						</td>
						<td>
							${rechargeLs.czorderno}
						</td>
						<td>
							${rechargeLs.lsno}
						</td>
						<td>
							<fmt:formatDate value="${rechargeLs.orderstartdate}" pattern="yyyy-MM-dd"/>
						</td>
						<td>
							${rechargeLs.paydate}
						</td>
					</tr>
				</c:forEach>
			</c:when>
			<c:otherwise>
				<tr>
					<td colspan="12" style="text-align: center;font-size:17px; font-family:SimHei">未查询到数据...</td>
				</tr>
			</c:otherwise>
			</c:choose>
		</tbody>
	</table>
	<div class="pagination">${page}</div>
</body>
</html>